package com.xinqi.modules.exam.paper.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 题目随机策略，1:不随机； 2:全部题目顺序随机； 3:同一题型内题目顺序随机
 *
 * @author linkai
 * @date 2023/7/2
 */
public enum ExamRandomStrategyEnum implements BaseEnum {
    不随机("1", "不随机"),
    全部题目顺序随机("2", "全部题目顺序随机"),
    同一题型内题目顺序随机("3", "同一题型内题目顺序随机"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    ExamRandomStrategyEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static ExamRandomStrategyEnum of(String code) {
        return BaseEnum.of(ExamRandomStrategyEnum.class, code);
    }
}
